{extend name="public/container"}
{block name="content"}
<link rel="stylesheet" href="{__ADMIN_PATH}css/mask.css">

<div class="layui-tab">
    <ul class="layui-tab-title">
        <li class="layui-this">代理参数</li>
        <li>自动审核</li>
    </ul>
    <div class="layui-tab-content">
        <div class="layui-tab-item layui-show">
            <form class="layui-form" action="">
                <div class="layui-form-item">
                    <label class="layui-form-label">代理开关</label>
                    <div class="layui-input-block">
                        <input type="radio" {if $data['is_open']==0}checked{/if} name="is_open" value="0"  title="关闭">
                        <input type="radio" {if $data['is_open']==1}checked{/if} name="is_open" value="1" title="开启" >
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">代理方式</label>
                    <div class="layui-input-block">
                        <input type="radio" {if $data['proxy_way']==1}checked{/if} name="proxy_way" value="1"  checked="" title="非区域代理">
                        <!--                        <input type="radio" {if $data['proxy_way']==2}checked{/if} name="proxy_way" value="2" title="区域代理" >-->
                    </div>
                </div>
                <ins class="adsbygoogle" style="display:inline-block;width:970px;height:10px;background-color:#f5f5f5" data-ad-client="ca-pub-6111334333458862" data-ad-slot="3820120620"></ins>
                <h3 style="color: rebeccapurple">代理名称：</h3>
                <div class="layui-form-item">
                    <label class="layui-form-label">一级代理代理显示名称</label>
                    <div class="layui-input-inline">
                        <input type="text" value="{$data.one_name}"  name="one_name"  placeholder="请输入一级代理名称" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">二级代理代理显示名称</label>
                    <div class="layui-input-inline">
                        <input type="text" value="{$data.two_name}"   name="two_name"  placeholder="请输入二级代理名称" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">三级代理代理显示名称</label>
                    <div class="layui-input-inline">
                        <input type="text" value="{$data.three_name}"  name="three_name"  placeholder="请输入三级代理名称" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <ins class="adsbygoogle" style="display:inline-block;width:970px;height:10px;background-color:#f5f5f5" data-ad-client="ca-pub-6111334333458862" data-ad-slot="3820120620"></ins>
                <h3 style="color: rebeccapurple">代理佣金：</h3>
                <div class="layui-form-item">
                    <label class="layui-form-label">一级代理代理佣金(%)</label>
                    <div class="layui-input-inline">
                        <input type="text"  value="{$data.one_percent}" name="one_percent"  placeholder="请输入一级代理佣金" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">二级代理代理佣金(%)</label>
                    <div class="layui-input-inline">
                        <input type="text" value="{$data.two_percent}"  name="two_percent"   placeholder="请输入二级代理佣金" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">三级代理代理佣金(%)</label>
                    <div class="layui-input-inline">
                        <input type="text" value="{$data.three_percent}"   name="three_percent"  placeholder="请输入三级代理佣金" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <ins class="adsbygoogle" style="display:inline-block;width:970px;height:10px;background-color:#f5f5f5" data-ad-client="ca-pub-6111334333458862" data-ad-slot="3820120620"></ins>
                <div class="layui-form-item">
                    <div class="layui-input-block">
                        <button class="layui-btn" onclick="go_sub2()">保存</button>
                    </div>
                </div>
            </form>
        </div>
        <div class="layui-tab-item">
            <form class="layui-form" action="">
                <h3 style="color: rebeccapurple">代理充值升级：</h3>
                <div class="layui-form-item">
                    <label class="layui-form-label">一级代理充值升级(元)</label>
                    <div class="layui-input-inline">
                        <input type="text" value="{$data.one_recharge}"   name="one_recharge"   placeholder="一级代理充值升级" autocomplete="off" class="layui-input">
                    </div>
                    <div class="layui-form-mid layui-word-aux">即充值多少元成为一级代理</div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">二级代理充值升级(元)</label>
                    <div class="layui-input-inline">
                        <input type="text" value="{$data.two_recharge}"   name="two_recharge"   placeholder="二级代理充值升级" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">三级代理充值升级(元)</label>
                    <div class="layui-input-inline">
                        <input type="text" value="{$data.three_recharge}"  name="three_recharge"  placeholder="三级代理充值升级" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <ins class="adsbygoogle" style="display:inline-block;width:970px;height:10px;background-color:#f5f5f5" data-ad-client="ca-pub-6111334333458862" data-ad-slot="3820120620"></ins>
                <h3 style="color: rebeccapurple">代理消费升级：</h3>
                <div class="layui-form-item">
                    <label class="layui-form-label">一级代理消费升级(元)</label>
                    <div class="layui-input-inline">
                        <input type="text" value="{$data.one_buy}"  name="one_buy" placeholder="一级代理消费升级" autocomplete="off" class="layui-input">
                    </div>
                    <div class="layui-form-mid layui-word-aux">即消费多少元成为一级代理</div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">二级代理消费升级(元)</label>
                    <div class="layui-input-inline">
                        <input type="text" value="{$data.two_buy}"   name="two_buy"  placeholder="二级代理消费升级" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">三级代理消费升级(元)</label>
                    <div class="layui-input-inline">
                        <input type="text" value="{$data.three_buy}"   name="three_buy"  placeholder="三级代理消费升级" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <ins class="adsbygoogle" style="display:inline-block;width:970px;height:10px;background-color:#f5f5f5" data-ad-client="ca-pub-6111334333458862" data-ad-slot="3820120620"></ins>
                <h3 style="color: rebeccapurple">代理购买指定商品升级：</h3>
                <div class="layui-form-item">
                    <label class="layui-form-label">一级代理购买指定商品</label>
                    <div class="layui-input-inline">
                        <input type="text" value="{$data.one_goods}"  name="one_goods" placeholder="指定商品id" autocomplete="off" class="layui-input">
                    </div>
                    <div class="layui-form-mid layui-word-aux">即购买指定商品成为一级代理（填入商品id,多商品用英文逗号隔开如1,2）</div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">二级代理购买指定商品</label>
                    <div class="layui-input-inline">
                        <input type="text" value="{$data.two_goods}"   name="two_goods"  placeholder="指定商品id" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">三级代理购买指定商品</label>
                    <div class="layui-input-inline">
                        <input type="text" value="{$data.three_goods}"   name="three_goods"  placeholder="指定商品id" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <ins class="adsbygoogle" style="display:inline-block;width:970px;height:10px;background-color:#f5f5f5" data-ad-client="ca-pub-6111334333458862" data-ad-slot="3820120620"></ins>

                <div class="layui-form-item">
                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <button class="layui-btn" onclick="go_sub2()">保存</button>
                        </div>
                    </div>
            </form>
        </div>
    </div>
</div>
<!--遮罩-->
{if $version<4}
<div class="mask">
    <div class="m-box">
        <div class="b-title">温馨提示：</div>
        <p>当前版本不支持此功能，请前往升级到社群版</p>
        <p style="text-align: center"><img src="{__ADMIN_PATH}/images/ku.png" width="100px"></p>
        <a type="button" href="{$buy_url}" target="_blank">立即前往</a>
    </div>
</div>
{/if}
<script src="{__ADMIN_PATH}js/layuiList.js"></script>
<!-- 注意：如果你直接复制所有代码到本地，上述js路径需要改成你本地的 -->
<script>
    layList.form.render();
    function go_sub2() {
        var is_open         = $('input[name=is_open]:checked').val();
        var proxy_way       = $('input[name=proxy_way]:checked').val();
        var one_name        = $('input[name=one_name]').val();
        var two_name        = $('input[name=two_name]').val();
        var three_name      = $('input[name=three_name]').val();
        var one_percent     = $('input[name=one_percent]').val();
        var two_percent     = $('input[name=two_percent]').val();
        var three_percent   = $('input[name=three_percent]').val();
        var one_recharge    = $('input[name=one_recharge]').val();
        var two_recharge    = $('input[name=two_recharge]').val();
        var three_recharge  = $('input[name=three_recharge]').val();
        var one_buy         = $('input[name=one_buy]').val();
        var two_buy         = $('input[name=two_buy]').val();
        var three_buy       = $('input[name=three_buy]').val();
        var one_goods       = $('input[name=one_goods]').val();
        var two_goods       = $('input[name=two_goods]').val();
        var three_goods     = $('input[name=three_goods]').val();
        var url = "{:url('save_data_two')}";
        var data = {
                    'is_open':is_open,
                    'proxy_way':proxy_way,
                    'one_name':one_name,
                    'two_name':two_name,
                    'three_name':three_name,
                    'one_percent':one_percent,
                    'two_percent':two_percent,
                    'three_percent':three_percent,
                    'one_recharge':one_recharge,
                    'two_recharge':two_recharge,
                    'three_recharge':three_recharge,
                    'one_buy':one_buy,
                    'two_buy':two_buy,
                    'three_buy':three_buy,
                    'one_goods':one_goods,
                    'two_goods':two_goods,
                    'three_goods':three_goods,
        };
        $eb.axios.post(url,data).then(function(res){
            if(res.data.code == 200) {
                $eb.$swal('success', res.data.msg);
                setTimeout(function () {
                    window.location.reload();
                },1000);
            }else
                $eb.$swal('error',res.data.msg||'操作失败!');
        });
    }
</script>
{/block}
</body>
</html>